let result = {
  code: 200,
  state: 'ok',
  goodCate: '电子产品',
  goodsList: [
    {
      id: 100012,
      goodsPrice: 6999,
      goodsName: 'MateBook',
      goodsCount: 99,
      goodsRank: 1,
      goodsBrand: 'HUAWEI',
    },
    {
      id: 100032,
      goodsPrice: 4999,
      goodsName: 'Air13',
      goodsCount: 86,
      goodsRank: 3,
      goodsBrand: 'XIAOMI',
    },
    {
      id: 100095,
      goodsPrice: 16000,
      goodsName: 'MacBookPro',
      goodsCount: 14,
      goodsRank: 2,
      goodsBrand: 'Apple',
    },
  ],
}

if (result.code==200) { 
    for (let i = 0; i < result.goodsList.length; i++) {
        let obj = result.goodsList[i]
        //需求2
        console.log(obj)
        //需求3
        obj.goodsName == 'Air13' ? console.log('Air13的价格为：' + obj.goodsPrice) : ``
        //需求4
        if (obj.goodsPrice == 16000) {
            obj.tag = '好用、快速、性价比高'
            console.log(obj);
        }
        //需求5
        obj.goodsName.length>6?console.log(`商品名长度：${obj.goodsName.length}\n商品名：${obj.goodsName}`):``
    }
}